#ifndef GRAPHICS_MESH_H
#define GRAPHICS_MESH_H


#include <graphics/node.h>
#include <render/shader.h>
#include <core/core.h>
#include <math/math.h>
#include <core/object.h>
#include <core/ref.h>

namespace yam3d
{


namespace graphics
{
    class VertexBuffer;
    class IndexBuffer;
    class Camera;


    class Mesh : public core::Object
    {
    public:
        Mesh( VertexBuffer* vb, IndexBuffer* ib );
        virtual ~Mesh();

        VertexBuffer* getVertexBuffer() const;
        IndexBuffer* getIndexBuffer() const;

     //   void renderGeometryWithShader( render::ShaderProgram* program, Camera* camera );
       // void getBoundingBox( math::vec3& min, math::vec3& max );

        struct Triangle
        {
            math::vec3 v1;
            math::vec3 v2;
            math::vec3 v3;
        };

        typedef core::vector<Triangle> TriangleListType;

        void getTriangles(TriangleListType* triangles) const;
    private:
        core::Ref<VertexBuffer> m_vb;
        core::Ref<IndexBuffer> m_ib;

        Mesh(const Mesh&);
        Mesh& operator=(const Mesh&);
    };

    class Light : public core::Object
    {
    public:
        Light( );
        virtual ~Light();
    private:
        Light(const Light&);
        Light& operator=(const Light&);

    };
}
}

#endif // GRAPHICS_MESH_H
